package android.gpsmessenger;

import android.os.Bundle;

public class HelpContactListFragment extends ContactListFragment
{
	
	public void onCreate (Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setHasOptionsMenu(true);
		
		id = "help";
		layoutID = R.layout.fragment_help_contacts;
	}
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) 
	{
		super.onActivityCreated(savedInstanceState);
	
	    contactAdapter.setContacts(contacts.getHelpContacts().getContactList());
    }
	
	public void onResume() 
	{
		super.onResume();
	    
	    contactAdapter.setContacts(contacts.getHelpContacts().getContactList());
	}
	
	public void remove(Contact contact) 
	{
		contacts.remove(contact);
		contactManager.save(contacts);
		
		contactAdapter.setContacts(contactManager.load().getHelpContacts().getContactList())  ;
		listView.setAdapter(contactAdapter);			
		
		contactAdapter.setSelectedPosition(-1);
		getActivity().invalidateOptionsMenu();
	}
	
}

